﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Abp.Application.Services;
using AVISOutBound.SSOServer.Payment.Alipay;
using AVISOutBound.SSOServer.Payment.Dto;
using AVISOutBound.SSOServer.Payment.Wechat;

namespace AVISOutBound.SSOServer.Payment
{
    /// <summary>
    /// 支付单服务
    /// </summary>
    public interface IPayOrderAppService:IApplicationService
    {
        /// <summary>
        /// 创建支付单
        /// </summary>
        /// <param name="input">输入参数</param>
        /// <returns></returns>
        Task<PayOrderOutput> Create(CreatePayOrderInput input);

        /// <summary>
        /// 获取订单状态。轮询订单状态-判断是否支付成功
        /// </summary>
        /// <param name="orderNo">订单号</param>
        /// <returns></returns>
        Task<int> GetOrderStatus(string orderNo);

        /// <summary>
        /// 完成支付，支付宝支付后的回调
        /// </summary>
        /// <param name="receive">支付宝支付回调参数</param>
        /// <returns></returns>
        Task<bool> FinishPay(AlipayPayReceive receive);

        /// <summary>
        /// 完成支付，微信支付后的回调
        /// </summary>
        /// <param name="receive">微信支付回调参数</param>
        /// <returns></returns>
        Task<bool> WechatFinishPay(WechatPayReceive receive);
    }
}
